<template>
    <div>
        <classheader></classheader>
        <classsearch :allclass="allclass"></classsearch>
        <classlist :allclass="allclass" :grade="grade"></classlist>
        <classgrade :allclass="allclass" @change="handlechange"></classgrade>
    </div>
</template>

<script>
import classheader from './components/classheader'
import classsearch from './components/classsearch'
import classlist from './components/classlist'
import classgrade from './components/classgrade'
import axios from 'axios'

export default {
  name: 'Class', 
  components:{
    classheader,
    classsearch,
    classlist,
    classgrade
  },
  data() {
    return {
      allclass:{},
      grade:""
    }
  },
  methods:{
    getapi(){
      axios.get('/api/class/getAll').then(this.getapisucc)
    },
    getapisucc(msg){
      //console.log(msg)
      if(msg.data.ret){
        const data = msg.data.data
        this.allclass = data.allclass
      }
    },
    handlechange(grade){
      this.grade=grade
    },
  },
  mounted(){
    this.getapi()
  },
 
  
}
</script>

<style scoped>

</style>